var t = require;
var e = module;
var o = exports;
var n =
    (this && this.__extends) ||
    (function() {
        var t = function(e, o) {
            return (t =
                Object.setPrototypeOf ||
                ({ __proto__: [] }
                    instanceof Array &&
                    function(t, e) {
                        t.__proto__ = e;
                    }) ||
                function(t, e) {
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                })(e, o);
        };
        return function(e, o) {
            function n() {
                this.constructor = e;
            }
            t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
        };
    })(),
    r =
    (this && this.__decorate) ||
    function(t, e, o, n) {
        var r,
            a = arguments.length,
            i = a < 3 ? e : null === n ? (n = Object.getOwnPropertyDescriptor(e, o)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) i = Reflect.decorate(t, e, o, n);
        else
            for (var s = t.length - 1; s >= 0; s--)
                (r = t[s]) && (i = (a < 3 ? r(i) : a > 3 ? r(e, o, i) : r(e, o)) || i);
        return a > 3 && i && Object.defineProperty(e, o, i), i;
    };
Object.defineProperty(o, "__esModule", { value: !0 });
var a = t("BootConst"),
    i = t("EventData"),
    s = t("GameData"),
    c = t("Util"),
    l = t("View"),
    u = t("Platforms"),
    p = t("ConfS"),
    f = t("fun"),
    d = t("warehouse"),
    h = require("./仓库属性战斗力变化飘字"),
    y = cc._decorator,
    g = y.ccclass,
    v =
    (y.property,
        (function(t) {
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                return (e.res = "skillup"), (e.isMask = !0), (e.zIndex = 2), (e.data = new i.default(null)), e;
            }
            var o;
            return (
                n(e, t),
                (o = e),
                (e.prototype.onEnable = function() {
                    this.data.value = o.data;
                }),
                (e.prototype.view_icon = function(t, e) {
                    t.url.value = e.PropIcon;
                }),
                (e.prototype.view_name = function(t, e) {
                    t.string = e.Name;
                }),
                (e.prototype.view_lv = function(t, e) {
                    t.string = "" + f.getSkillLv(e.ID);
                }),
                (e.prototype.view_desc = function(t, e) {
                    var o = f.getSkillLv(e.ID),
                        n = f.getSkillBuff(e.ID, o);
                    t.string = n.description;
                }),
                (e.prototype.view_nextdesc = function(t, e) {
                    if (s.default.equips.includes(e.CoinNeed)) {
                        var o = f.getSkillLv(e.ID),
                            n = f.getSkillBuff(e.ID, o + 1);
                        n && (t.string = "下一级:" + n.description);
                    } else {
                        var r = p.DatasManager.EquipDatasById[e.CoinNeed];
                        t.string = "解锁需要装备:" + r.Name;
                    }
                }),
                (e.prototype.view_money = function(t, e) {
                    var o = f.getSkillBuff(e.ID);
                    t.set(o.Type, o.Need);
                }),
                (e.prototype.onClick = function(t) {
                    var e = this;
                    switch (t) {
                        case "close":
                            this.hideView();
                            break;
                        case "升级":
                            var o = this.showView(d.default).herodata.value.ID;
                            h.default.变化前属性(o);
                            var n = f.getSkillLv(this.data.value.ID),
                                r = f.getSkillBuff(this.data.value.ID);
                            c.pay(r.Type, r.Need, "技能升级", this, function() {
                                (s.default.skillLvs[e.data.value.ID] = n + 1),
                                (s.default.skillLvs = s.default.skillLvs),
                                e.data.emit(),
                                    h.default.变化后属性(o),
                                    u.default.platformCtrl.dd(a.dd.SkillLvUp, {
                                        CostType: r.Type,
                                        CostNeed: r.Need,
                                        eventTime: Date.now(),
                                        Coins: s.default.jb,
                                        Diamonds: s.default.zs,
                                        SkillLv: n + 1,
                                        HeroLV: f.getHeroLv(o),
                                        HeroID: o
                                    });
                            });
                    }
                }),
                (e = o = r([g], e))
            );
        })(l.default));
o.default = v;